	IDENTIFICATION DIVISION.
	PROGRAM-ID. CUSTDISC.
	ENVIRONMENT DIVISION.
	INPUT-OUTPUT SECTION.
	FILE-CONTROL.
	    SELECT SALES-FILE ASSIGN TO DISK.

	DATA DIVISION.
	FILE SECTION.
	FD SALES-FILE
	   LABEL RECORD STANDARD
	   VALUE OF FILE-ID IS "SALES.DBF".
	01 SALES-REC.
	    02 NAME   PIC X(10).
	    02 UNITS  PIC 99.

	WORKING-STORAGE SECTION.
	77  RATE    PIC 9(2).
	77  CH      PIC X.
	77  TOTSALE PIC 9(5) VALUE IS 0.
	77  AMOUNT  PIC 9(4).
	77  TEMP4   PIC Z(4).
	77  TEMP5   PIC Z(5).
	
	PROCEDURE DIVISION.
	MAINPARA.
	    DISPLAY "FILE CREATION".
	    OPEN OUTPUT SALES-FILE.

	WRITEPARA.
	    DISPLAY (LIN, COL) "CUSTOMER NAME:".
	    ACCEPT NAME.
	    DISPLAY (LIN, COL) "UNITS SOLD   :".
	    ACCEPT UNITS.
	    WRITE SALES-REC.
	    DISPLAY (LIN, COL) "CONTINUE <Y/N>?:".
	    ACCEPT CH.
	    IF CH IS NOT = "N" GO TO WRITEPARA.
	    CLOSE SALES-FILE.
	    DISPLAY " ".
	    DISPLAY "--- SALES REPORT ---".
	    DISPLAY "________________________________________".
	    DISPLAY " NAME           UNITS   RATE    AMOUNT".
	    DISPLAY "----------------------------------------".
	    OPEN INPUT SALES-FILE.

	READPARA.
	    READ SALES-FILE AT END GO TO PROGOVER.
	    IF UNITS > 20 MOVE 38 TO RATE ELSE MOVE 40 TO RATE.
	    COMPUTE AMOUNT = RATE * UNITS.
	    MOVE AMOUNT TO TEMP4.
	    ADD AMOUNT TO TOTSALE.
	    DISPLAY NAME, "       ", UNITS, "      ", RATE,
	    "     ", TEMP4.
	    GO TO READPARA.

	PROGOVER.
	    CLOSE SALES-FILE.
	    MOVE TOTSALE TO TEMP5.
	    DISPLAY "----------------------------------------".
	    DISPLAY " TOTAL SALES AMOUNT:           ", TEMP5.
	    DISPLAY "----------------------------------------".
	    DISPLAY " ".
	    ACCEPT CH.
	    STOP RUN.









